package com.dlyk.service.impl;

import com.dlyk.manager.StatisticManager;
import com.dlyk.result.NameValue;
import com.dlyk.result.SummaryData;
import com.dlyk.service.StatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StatisticServiceImpl implements StatisticService {

    @Autowired
    private StatisticManager statisticManager;

    /**
     * 加载概要统计数据
     * @return
     */
    @Override
    public SummaryData loadSummary() {
        return statisticManager.summaryData();
    }

    /**
     * 加载销售漏斗数据
     * @return
     */
    @Override
    public List<NameValue> loadSaleFunnelChart() {
        return statisticManager.loadSaleFunnel();
    }

    /**
     * 加载线索来源饼状图数据
     * @return
     */
    @Override
    public List<NameValue> loadResourcePieChart() {
        return statisticManager.loadResourcePie();
    }
}
